<template>
  <view class="my-search" :style="{'background-color' : bgcolor }" @click="btnSearch">
    <view class="my-search-box" :style="{'border-radius':radius + 'px'}" >
      <uni-icons type="search" size="17"></uni-icons> 
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgcolor:{
        type:String,
        default:'#C00000'
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      btnSearch(){
        console.log('~~~~~~');
        //给组件注册click事件
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
.my-search {
  height: 50px;
  // background-color: #C00000;
  padding: 0 10px;
  .my-search-box {
    height: 36px;
    background-color: #fff;
    // border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    text {
      font-size: 15px;
      margin-left: 5px;
    }
  }
}
</style>